{% if not isXhr %}
{% extends "base.html" %}
{% endif %}

{% block title %}
<title>{{ title|title }}</title>
{% endblock %}

{% block meta %}
<meta name="keywords" content="{{ tags }}" />
{% endblock %}

{% if not isXhr %}
{% block extra_scripts %}
<script src="/blog/static/js/ng.js"></script>

<script type="text/javascript">
  // bootstrap script
  window.articlePath = '{{ articlePath }}';
</script>
{% endblock %}
{% endif %}

{% block body %}
<aside class="col-md-2">
  <iframe src="http://rcm.amazon.com/e/cm?t=david0a-20&o=1&p=11&l=ez&f=ifr&f=ifr" width="120" height="600" scrolling="no" marginwidth="0" marginheight="0" border="0" frameborder="0" style="border:none;"></iframe>
</aside>
<div class="col-md-8">
  <nav id="breadcrumbs" class="row">
    <ul class="breadcrumb">
      {% for i in breadcrumbs %}
      {% if not loop.last %}
      <li><a href="{{i['href']}}">{{i['text']}}</a></li>
      {% else %}
      <li class="active">{{i['text']}}</li>
      {% endif %}
      {% endfor %}
    </ul>
  </nav>
  <article id="article" class="row">
    {% if month %}
    <ul class="nav nav-list">
      {% for title, urlsafe in archives[year][month] %}
      <li><a href="/blog/{{ year }}/{{ month }}/{{ urlsafe }}">{{ title }}</a></li>
      {% endfor %}
    </ul>
    {% elif year %}
    <ul class="nav nav-list">
      {% for m, tupes in archives[year].iteritems() %}
      <li class="nav-header">{{ monthFullName[m-1] }}</li>
      {% for title, urlsafe in tupes %}
      <li><a href="/blog/{{ year }}/{{ m }}/{{ urlsafe }}">{{ title }}</a></li>
      {% endfor %}
      {% endfor %}
    </ul>
    {% elif tag and tagstats[tag]%}
    <ul class="nav nav-list">
      {% for y, m, tupe in tagstats[tag] %}
      <li><a href="/blog/{{ y }}/{{ m }}/{{ tupe[1] }}">{{ tupe[0] }}</a></li>
      {% endfor %}
    </ul>
    {% endif %}
  </article>
</div>

{% include "blog/right_side.html" %}
{% endblock %}
